import { BasicColumn } from '@/design/components/Table';
import { h } from 'vue';
import { ElTag } from 'element-plus';

export const columns: BasicColumn[] = [
  {
    label: '角色名称',
    prop: 'name',
  },
  {
    label: '角色标识',
    prop: 'code',
  },
  {
    label: '排序',
    prop: 'sort',
  },
  {
    label: '状态',
    prop: 'status',
    render({ row: record }) {
      return h(
        ElTag,
        {
          type: record.status === 1 ? 'success' : 'danger',
        },
        {
          default: () => (record.status === 1 ? '正常' : '禁用'),
        },
      );
    },
  },
  {
    label: '备注',
    prop: 'note',
  },
  {
    label: '创建时间',
    prop: 'createTime',
  },
];
